home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / INTERNET.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-23  |  1.8 KB  |  72 lines

  1. /* Mods by PA0GRI */
  2. #ifndef    _INTERNET_H
  3. #define    _INTERNET_H
  4.  
  5. #ifndef    _GLOBAL_H
  6. #include "global.h"
  7. #endif
  8.  
  9. /* Global structures and constants pertaining to the interface between IP and
  10.  *     higher level protocols
  11.  */
  12.  
  13. /* IP protocol field values */
  14. #define    ICMP_PTCL    1    /* Internet Control Message Protocol */
  15. #define ENCAP_PTCL    4    /* new IP encap value */
  16. #define    TCP_PTCL    6    /* Transmission Control Protocol */
  17. #define    UDP_PTCL    17    /* User Datagram Protocol */
  18. #define    RSPF_PTCL    73    /* Radio Shortest Path First Protocol */
  19. #define    AX25_PTCL    93    /* AX25 inside IP according to RFC-1226 */
  20. #define    IP_PTCL        94    /* IP inside IP */
  21.  
  22. #define    MAXTTL        255    /* Maximum possible IP time-to-live value */
  23.  
  24. /* DoD-style precedences */
  25. #define    IP_PRECEDENCE    0xe0    /* Mask for precedence field */
  26. #define    ROUTINE        0x00
  27. #define    PRIORITY    0x20
  28. #define    IMMEDIATE    0x40
  29. #define    FLASH        0x60
  30. #define    FLASH_OVER    0x80
  31. #define    CRITIC        0xa0
  32. #define    INET_CTL    0xc0
  33. #define    NET_CTL        0xe0
  34.  
  35. /* Amateur-style precedences */
  36. #define    AM_ROUTINE    0x00
  37. #define    AM_WELFARE    0x20
  38. #define    AM_PRIORITY    0x40
  39. #define    AM_EMERGENCY    0x60
  40.  
  41. /* Class-of-service bits */
  42. #define    IP_COS        0x1c    /* Mask for class-of-service bits */
  43. #define    LOW_DELAY    0x10
  44. #define    THROUGHPUT    0x08
  45. #define    RELIABILITY    0x04
  46.  
  47. /* IP TOS fields */
  48. #define    PREC(x)        (((x)>>5) & 0x7)
  49. #undef DELAY
  50. #define    DELAY        0x10
  51. #define    THRUPUT        0x8
  52. #define    RELIABLITY    0x4
  53.  
  54. /* Pseudo-header for TCP and UDP checksumming */
  55. struct pseudo_header {
  56.     uint32 source;        /* IP source */
  57.     uint32 dest;        /* IP destination */
  58.     char protocol;        /* Protocol */
  59.     int16 length;        /* Data field length */
  60. };
  61. #define    NULLHEADER    (struct pseudo_header *)0
  62.  
  63. /* Format of a MIB entry for statistics gathering */
  64. struct mib_entry {
  65.     const char *name;
  66.     struct {
  67.         uint32 integer;
  68.     } value;
  69. };
  70.  
  71. #endif    /* _INTERNET_H */
  72.